/* popup.css - 页面专属样式 */

body {
    width: 320px;
    min-height: 350px;
    background: #f8f9fa;
    color: #333;
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.container {
    padding: 12px;
}

.header {
    text-align: center;
    margin-bottom: 8px;
    color: #333;
}

.header h1 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
}

.header .subtitle {
    font-size: 11px;
    color: #666;
    margin: 0;
}

/* 卡片样式 */
.status-card {
    background: #ffffff;
    color: #333;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* API状态 */
.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc3545;
}

.status-indicator.connected {
    background: #28a745;
}

.status-text {
    font-size: 12px;
    color: #666;
    flex: 1;
}

/* SSO 容器 */
.sso-container {
    margin-top: 8px;
}

.sso-container.hidden {
    display: none;
}

.btn {
    width: 100%;
    margin-bottom: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline {
    background: transparent;
    color: #007bff;
    border: 1px solid #007bff;
}

.btn-outline:hover:not(:disabled) {
    background: #007bff;
    color: white;
}

.logout-container {
    margin-top: 6px;
    display: none;
}

.logout-container.show {
    display: block;
}

/* 加载动画 */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 警告消息 */
.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 6px;
    text-align: center;
}

/* 抓取规则 */
.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rules-info {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.btn-small {
    padding: 5px 10px;
    font-size: 11px;
}

.rules-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: #f8f9fa;
}

.rule-item {
    padding: 6px 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.rule-item:last-child {
    border-bottom: none;
}

.rule-content {
    flex: 1;
}

.rule-name {
    font-size: 12px;
    font-weight: 500;
    color: #007bff;
    margin-bottom: 2px;
}

.rule-pattern {
    font-size: 11px;
    font-family: monospace;
    color: #6c757d;
    margin-bottom: 2px;
    word-break: break-all;
}

.rule-description {
    font-size: 10px;
    color: #666;
}

.rule-priority {
    font-size: 10px;
    color: #28a745;
    font-weight: 500;
    margin-left: 8px;
    white-space: nowrap;
} 

/* Toast 消息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: #28a745;
    border-left: 4px solid #1e7e34;
}

.toast-error {
    background: #dc3545;
    border-left: 4px solid #bd2130;
}

.toast-warning {
    background: #ffc107;
    color: #212529;
    border-left: 4px solid #e0a800;
}

.toast-info {
    background: #17a2b8;
    border-left: 4px solid #138496;
}

.status-indicator.token-expired {
    background: #ffc107;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
} 